@extends('admin.layouts.index')
@section('title', '小程序列表')
@section('content')
<div class="row">
    <div class="col-md-12">
        <div class="card">
            <div class="card-body">
                <form class="m-search" method="GET" action="{{ URL::current() }}">
                    <div class="m-search-items">
                        <div class="m-search-item">
                            <label>卡片名称</label>
                            <input type="text" name="title" placeholder="请输入卡片名称">
                        </div>
                        <div class="m-search-item">
                            <label>卡片描述</label>
                            <input type="text" name="describe" placeholder="请输入卡片描述">
                        </div>
                        <div class="m-search-item">
                            <label>外链ID</label>
                            <input type="text" name="links_id" placeholder="请输入外链ID">
                        </div>
                        <div class="m-search-item">
                            <button class="button">搜索</button>
                        </div>
                    </div>
                </form>

                <div class="self-table-responsive">
                    <table class="table table-bordered table-nowrap">
                        <thead>
                            <tr>
                                <th scope="col">外链ID</th>
                                <th scope="col">卡片内容</th>
                                <th scope="col">卡片类型</th>
                                <th scope="col">状态</th>
                                <th scope="col">创建时间</th>
                                <th scope="col">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            @forelse($linkCards as $linkCard)
                            <tr>
                                <td>{{ $linkCard->links_id }}</td>
                                <td>
                                    <div class="card-douyin" style="margin:0;background-color: #F2F5F5;max-width: 300px;">
                                        <img src="{{ $linkCard->logo }}" style="width: 60px;height: 60px;">
                                        <div class="info">
                                            <h3 style="font-size: 14px;">{{ $linkCard->title }}</h3>
                                            <h5 style="font-size: 12px;">{{ $linkCard->describe }}</h5>
                                        </div>
                                    </div>
                                </td>
                                @if($linkCard->type == "dy")
                                <td>抖音卡片</td>
                                @elseif($linkCard->type == "wx")
                                <td>微信卡片</td>
                                @else
                                <td>知乎卡片</td>
                                @endif
                                @if($linkCard->disable == 1)
                                <td class="text-success">正常</td>
                                @else
                                <td class="text-danger">禁用</td>
                                @endif
                                <td>{{ $linkCard->created_at }}</td>
                                <td>
                                    <div class="table-handdle-td">
                                        <a href="/admin/links_lists/links_lists_detial/{{ $linkCard->links_id }}" target="_blank" class="table-handdle-link">外链详情</a>
                                        <div class="dropdown-handle table-handdle-menu" data-bs-toggle="dropdown"  aria-expanded="false">
                                            <font>更多操作</font>
                                            <i class="bx bx-chevron-down"></i>
                                        </div>
                                        <div class="dropdown-menu">
                                            @if($linkCard->disable == 2)
                                            <a href="{{ url('/admin/manage/links_card_disable',['links_id'=>$linkCard->links_id]) }}" class="dropdown-item text-warning">解除卡片禁用</a>
                                            @else
                                            <a class="dropdown-item text-warning" href="{{ url('/admin/manage/links_card_disable',['links_id'=>$linkCard->links_id]) }}">禁用卡片</a>
                                            @endif
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            @empty
                            <tr>
                                <td colspan="6">没有找到您想要的卡片</td>
                            </tr>
                            @endforelse
                        </tbody>
                    </table>
                    <div class="pagination-container">
                        {!! $linkCards->render() !!}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<link rel="stylesheet" type="text/css" href="/assets/css/card-setting.css">
@endsection
